package www.ld.com.domain.user.vo;


import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import www.ld.com.core.group.InsertGroup;
import www.ld.com.core.group.UpdateGroup;
import www.ld.com.dictionary.SexStatusEnum;
import www.ld.com.dictionary.UserStatusEnum;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;


@Data
@Accessors(chain = true)
@ToString
@EqualsAndHashCode
public class InUserVO {
    @ApiModelProperty(value = "ID")
    @NotNull(message = "用户ID不能为空",groups = UpdateGroup.class)
    private Long id;
    @ApiModelProperty(value = "姓名")
    @NotBlank(message = "姓名不能为空")
    @Length(max = 20,min = 2,message = "姓名必须是{min}~{max}个字符",groups = {UpdateGroup.class, InsertGroup.class})
    private String name;
    @ApiModelProperty(value = "帐号")
    @NotBlank(message = "帐号不能为空",groups = InsertGroup.class)
    @Length(max = 20,min = 2,message = "帐号必须是{min}~{max}个字符",groups = InsertGroup.class)
    private String username;
    @ApiModelProperty(value = "密码")
    @NotBlank(message = "密码不能为空",groups = InsertGroup.class)
    private String password;
    @ApiModelProperty(value = "部门")
    private String departmentId;
    @Length(max = 15,message = "联系电话不能大于{max}字符",groups = {UpdateGroup.class, InsertGroup.class})
    @ApiModelProperty(value = "电话")
    private String phone;
    @Length(max = 20,message = "邮件不能大于{max}字符" ,groups = {UpdateGroup.class, InsertGroup.class})
    @ApiModelProperty(value = "邮件")
    private String email;
    @ApiModelProperty(value = "性别")
    @NotNull(message = "性别不能为空",groups = {UpdateGroup.class, InsertGroup.class})
    private SexStatusEnum sex;
    @ApiModelProperty(value = "备注")
    @Length(max = 255,message = "备注不不能大于{max}个字符",groups = {UpdateGroup.class, InsertGroup.class})
    private String remarks;
    @NotNull(message = "帐号状态不能为空",groups = {UpdateGroup.class, InsertGroup.class})
    private UserStatusEnum status;
    @ApiModelProperty(value = "岗位Id")
    private List<String> postIds;
    @ApiModelProperty(value = "角色Id")
    private List<String> rolesIds;
}

